package net.angrynut.web.model.converter;

import org.springframework.core.convert.converter.Converter;

import net.angrynut.web.model.dto.LoginForm;
import net.angrynut.web.model.entity.User;

/**
 * Spring 类型转换示例。
 */
public class LoginFormToUserConverter implements Converter<LoginForm, User> {

	@Override
	public User convert(LoginForm form) {
		User user = new User();
		user.setUsername(form.getUsername());
		user.setPassword("******");
		return user;
	}

}
